// 选择
function changeNumber() {


    let totals = document.querySelector('.price');
    let unitprices = document.querySelector('#unitPrice');
    let lis = document.querySelectorAll('.qrcode')
    lis.forEach(function(li, index) {
        li.addEventListener('click', function() {
            lis.forEach(function(li, index) {
                lis[index].classList.remove('selected');
            })
            this.classList.add('selected')
            let total = this.getAttribute('total');
            let unitprice = this.getAttribute('unitprice')
            unitprices.textContent = unitprice;
            totals.textContent = '￥' + total

        })
    })
}
changeNumber()
    // 选项卡内容切换
function conChange() {
    let lis = document.querySelectorAll(".option li");
    let level = document.querySelectorAll('.tabcon');
    lis.forEach(function(li, index) {
        li.addEventListener('click', function() {
            lis.forEach(function(li, index) {
                li.classList.remove('active')
                level[index].classList.remove('on')
            })
            this.classList.add('active');
            level[index].classList.add('on')
        })
    })
}
conChange()